
import axios from '../http/request'

const methods = {
    // 封装get请求
    get: (params, url, requestType) => {
        return axios({
            url: url,
            method: 'GET',
            params: params,
            headers: {
                "Content-Type": requestType || 'application/x-www-form-urlencoded'
            }
        })
    },
    // 封装post请求
    post: (params, url, requestType) => {
        return axios({
            url: url,
            method: 'POST',
            params: params,
            headers: {
                "Content-Type": requestType || 'application/x-www-form-urlencoded'
            }
        })
    },

    // 封装put请求
    put: (params, url, requestType) => {
        return axios({
            url: url,
            method: 'PUT',
            params: params,
            headers: {
                "Content-Type": requestType || 'application/x-www-form-urlencoded'
            }
        })
    },
    // 封装put请求
    del: (params, url, requestType) => {
        return axios({
            url: url,
            method: 'DELETE',
            params: params,
            headers: {
                "Content-Type": requestType || 'application/x-www-form-urlencoded'
            }
        })
    }
}

export default { ...methods }